package eu.fishcode.android.ui.component;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RadialGradientPaint;
import java.awt.geom.Point2D;

import javax.swing.JPanel;

public class Panel extends JPanel {

	public Panel() {
		super();
		//this.setOpaque(true);
		this.setBackground(new Color(0xcf, 0xde, 0xf0, 0));
	}

	@Override
	protected void paintComponent(Graphics g) {
		final Graphics2D g2 = (Graphics2D) g.create();

		final RadialGradientPaint p = new RadialGradientPaint(
				new Point2D.Double(this.getWidth() / 2.0, 1),
				(int) (this.getWidth() / 1.3), new Point2D.Double(
						this.getWidth() / 2.0, 40), new float[] { 0.0f, 1.0f },
				new Color[] { new Color(0x86, 0xab, 0xd9),
						new Color(0xcf, 0xde, 0xf0, 0) },
				RadialGradientPaint.CycleMethod.NO_CYCLE);
		g2.setPaint(p);

		g2.fillRect(5, 20, this.getWidth() - 10, 1);
		g2.dispose();
		super.paintComponent(g);
	}

}
